import Vue from 'vue'
import App from './App'
import router from './router'

// 引用API文件
import api from './api/index.js'
// 将API方法绑定到全局
Vue.prototype.$api = api

// 引用工具文件
import utils from './utils/index.js'
// 将工具方法绑定到全局
Vue.prototype.$utils = utils

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App },

  watch:{
    '$route' (to,from){
      if(this.$route.params.articleId){
        console.log(this.$route.params.articleId);
      }
      console.log("to:"+to.path+"\n"+"from:"+from.path);
    }
  },
})
